package com.zy.hash;

/**
 * @author zhaoyi
 * @date 2021/4/25 16:44
 * <p>
 * 0 <= key <= 10^6
 * 最多调用 104 次 add、remove 和 contains
 */
public class MyHashSet {


    boolean[] values;

    /**
     * Initialize your data structure here.
     */
    public MyHashSet() {
        values = new boolean[2000000];
        //Arrays.fill(values, false);
    }

    public void add(int key) {
        values[key] = true;
    }

    public void remove(int key) {
        values[key] = false;
    }

    /**
     * Returns true if this set contains the specified element
     */
    public boolean contains(int key) {
        return values[key];
    }

}
